#encoding : utf-8

class CommentsController < ApplicationController

  #新增评论
  def create

    @comment = Comment.create(:blog_id => params[:blog_id], :content => params[:content])

    if @comment.save
      #render :json => {code: 200}
      render :json => {:code => 200, :content => @comment}
    else
      render :json => {:code => 500, :msg => '评论提交失败,请稍后再试'}
    end
  end

  def edit

  end

  def update

    redirect_to :controller => 'blogs', :action => 'list', :locale => @comment
  end

  def destroy

  end
end